# -*- encoding=utf8 -*-
"""
RedFlag-TC000075   拍照时配乐功能检查
拍照时应用配乐场景
"""
__author__ = "ldm"

import sys
import os

# 获取当前脚本所在目录.py
current_dir = os.path.dirname(os.path.abspath(__file__))
# 获取上级目录.air
parent_dir = os.path.dirname(current_dir)
# 获取上级目录air
grandparent_dir = os.path.dirname(parent_dir)
# 获取和air目录平级的conf、testcase目录路径
conf_dir = os.path.join(grandparent_dir, 'conf')
testcase_dir = os.path.join(grandparent_dir, 'testcase')
# 将conf、testcase目录添加到sys.path
sys.path.append(conf_dir)
sys.path.append(testcase_dir)

from PageFunction import CameraVideoShooter
from elements import *
auto_setup(__file__)

shooter = CameraVideoShooter()

log("--------------------------------拍摄暂停唤起滤镜工具栏检查右侧图标数量场景--------------------------------------")
"""
进入拍照
点击配乐
选择配乐一
获取文本
断言
"""

shooter.enter_photo()
shooter.click_element(shooting_page_Music_button)
shooter.click_element(shooting_page_Song_one)
music_text = shooter.get_element_text(shooting_page_music_text)
shooter.assert_texts_equal(music_text, "一定要爱你—魏新雨", "断言失败，预期文案与实际文案不符合，配乐失败")

# 关闭应用
stop_app(UGC_package_name)